using System;
using System.Collections.Generic;
using System.Reflection;

namespace SiliverlightJavascriptIntelli
{
    public static class SilverlightJavascriptIntellisenseGenrator
    {
        public static string GetJavascript()
        {
            List<SilverlightType> TypesToGenerateJavascriptFor = SilverlightTypeCollctor.GetTypesToGenerateJavascriptFor();
           // HostTypeHelper.AddHostTypesTo(TypesToGenerateJavascriptFor);
            TypeHelper.KnownTypesAfterDiscovery = TypesToGenerateJavascriptFor;
            return SilverlightTypestoJavascriptConverter.GetJavascriptTextForSilverlightTypes(TypesToGenerateJavascriptFor);
         }

        //public static string GetRuntimeJavascript()
        //{
        //    if (TypeHelper.KnownTypesAfterDiscovery.Count == 0)
        //        throw new ApplicationException("GetJavascript() musr run before GetRuntimeJavascript()");

        //    return SilverlightTypestoJavascriptConverter.GetJavascriptTextForSilverlightTypes(TypeHelper.KnownTypesAfterDiscovery, true);
        //}

    }
}